package com.rc.evcharger.service.rc;

import com.rc.evcharger.mapper.rc.RcChannelGainRecordMapper;
import com.rc.evcharger.model.rc.RcChannelGainRecord;
import com.rc.evcharger.model.rc.RcChannelGainRecordExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RcChannelGainRecordServiceImpl implements RcChannelGainRecordService {
    @Autowired
    private RcChannelGainRecordMapper rcChannelGainRecordMapper;

    @Override
    public RcChannelGainRecordMapper getMapper() {
        return rcChannelGainRecordMapper;
    }

    @Override
    public List<RcChannelGainRecord> listCurrentByMemberId(Long memberId) {
        RcChannelGainRecordExample example = new RcChannelGainRecordExample();
        example.createCriteria().andMemberIdEqualTo(memberId).andStatusEqualTo("0");
        example.setOrderByClause("created_time desc");
        return rcChannelGainRecordMapper.selectByExample(example);
    }
}
